//
//  SVProgressHUD+Category.m
//  KeleAppProject
//
//  Created by Cen Zhou on 2018/1/11.
//  Copyright © 2018年 Cen Zhou. All rights reserved.
//

#import "SVProgressHUD+Category.h"

@implementation SVProgressHUD (Category)

+ (void)initialize
{
    [SVProgressHUD setDefaultStyle:SVProgressHUDStyleDark];
    [SVProgressHUD setDefaultAnimationType:SVProgressHUDAnimationTypeNative];
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeClear];
    [SVProgressHUD setCornerRadius:6.0];
}

+ (void)loading {
    [SVProgressHUD setMinimumSize:CGSizeMake(65, 65)];
    [SVProgressHUD show];
}

+ (void)showLoading:(NSString *)message
{
    [SVProgressHUD setMinimumSize:CGSizeMake(100, 100)];
    if(!message || [message isEqualToString:@""]){
        [SVProgressHUD show];
    }else{
        [SVProgressHUD showWithStatus:message];
    }
    
}

+ (void)showNetworkError
{
    [SVProgressHUD setMinimumSize:CGSizeMake(280, 100)];
    [SVProgressHUD showInfoWithStatus:@"当前网络不可用，请检查你的网络设置"];
    [SVProgressHUD dismissWithDelay:1.0];
}

+ (void)showAlert:(NSString *)message
{
    [SVProgressHUD setMinimumSize:CGSizeMake(120, 120)];
    [SVProgressHUD showInfoWithStatus:message];
    [SVProgressHUD dismissWithDelay:1.0];
}

+ (void)showError:(NSString *)message
{
    [SVProgressHUD setMinimumSize:CGSizeMake(120, 120)];
    [SVProgressHUD showErrorWithStatus:message];
    [SVProgressHUD dismissWithDelay:2.0];
}

+ (void)showSuccess:(NSString *)message
{
    [SVProgressHUD setMinimumSize:CGSizeMake(120, 120)];
    [SVProgressHUD showSuccessWithStatus:message];
    [SVProgressHUD dismissWithDelay:1.0];
}


@end
